using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;

namespace EmailCenter_SEK53
{
    public partial class Login : DevComponents.DotNetBar.Office2007Form
    {
        public string Host { get; set; }
        public int Port { get; set; }
        public string Email { get; set; }
        public string Password { get; set; }
        public bool IsSecure { get; set; }
        public bool AutoLogin { get; set; }

        public Login()
        {
            InitializeComponent();
        }

        private void btOk_Click(object sender, EventArgs e)
        {
            try
            {
                this.Host = tbHost.Text;
                this.Port = Int32.Parse(tbPort.Text);
                this.Email = tbUsername.Text;
                this.Password = tbPassword.Text;
                this.IsSecure = cbSecure.Checked;
                this.AutoLogin = cbAutoLogin.Checked;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void Login_Load(object sender, EventArgs e)
        {
            tbHost.Text = this.Host;
            tbPort.Text = this.Port.ToString();
            tbUsername.Text = this.Email;
            tbPassword.Text = this.Password;
            cbSecure.Checked = this.IsSecure;
            cbAutoLogin.Checked = this.AutoLogin;
        }
    }
}